//
//  SZCalendarCell.m
//  SZCalendarPicker
//
//  Created by Stephen Zhuang on 14/12/1.
//  Copyright (c) 2014年 Stephen Zhuang. All rights reserved.
//

#import "SZCalendarCell.h"

@implementation SZCalendarCell
- (UILabel *)dateLabel
{
    if (!_dateLabel) {
        NSInteger itemWidth = IPHONE_WIDTH/7;
        _dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, itemWidth, self.contentView.height)];
        [_dateLabel setTextAlignment:NSTextAlignmentCenter];
        [_dateLabel setFont:[UIFont systemFontOfSize:17]];
        [self addSubview:_dateLabel];
    }
    return _dateLabel;
}

-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
 //       self.backgroundColor=[UIColor greenColor];
//        _dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, self.contentView.width-10, self.contentView.hidden-10)];
//        [self.contentView addSubview:_dateLabel];
        
        CGFloat width=(IPHONE_WIDTH/7-24)/4;//原点间隔

        //CGRectMake(_laterLabel.x+_laterLabel.width+width, self.contentView.height-15, 8, 8)
        _leaveLabel=[MyControl creatLabelWithFrame:CGRectMake(width, self.contentView.height-14, 8, 8) text:@""];
        _leaveLabel.hidden=YES;
        _leaveLabel.layer.masksToBounds=YES;
        _leaveLabel.layer.cornerRadius=_leaveLabel.width/2;
        _leaveLabel.backgroundColor=[UIColor yellowColor];
        [self.contentView addSubview:_leaveLabel];
        
        _laterLabel=[MyControl creatLabelWithFrame:CGRectMake(_leaveLabel.x+_leaveLabel.width+width, self.contentView.height-14, 8, 8) text:@""];
        _laterLabel.hidden=YES;
        _laterLabel.layer.masksToBounds=YES;
        _laterLabel.layer.cornerRadius=_laterLabel.width/2;
        _laterLabel.backgroundColor=[UIColor redColor];
        [self.contentView addSubview:_laterLabel];
        
        _absenteeismLabel=[MyControl creatLabelWithFrame:CGRectMake(_leaveLabel.x+_leaveLabel.width+width, self.contentView.height-14, 8, 8) text:@""];
        _absenteeismLabel.hidden=YES;
        _absenteeismLabel.layer.masksToBounds=YES;
        _absenteeismLabel.layer.cornerRadius=_absenteeismLabel.width/2;
        _absenteeismLabel.backgroundColor=[UIColor greenColor];
        [self.contentView addSubview:_absenteeismLabel];
        //initialize code...
    }
    return self;
}

//- (void)hideImageView{
//    _laterLabel.hidden=YES;
//    _leaveLabel.hidden=YES;
//    _absenteeismLabel.hidden=YES;
//}

@end
